package com.smartwebx.ha.web.admin.module.screen.report;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.smartwebx.ha.biz.assign.HaReportManager;
import com.smartwebx.ha.web.admin.common.HaUserSys;
/**
 * 
 * 创建人：Dream~天涯 
 * 创建时间：2015-4-22 上午9:57:35
 * 邮箱：154494796@qq.com
 * 备注：
 */
public class AjaxUserTree {
	@Autowired
	private HttpServletResponse response;
	@Autowired
	private HaReportManager haReportManager;
	@Autowired
	private HttpSession session;
	public void execute() throws Exception{
		HaUserSys user=(HaUserSys) session.getAttribute("haUser");
		response.setContentType("application/json");
		PrintWriter out=response.getWriter();
		ObjectMapper mapper=new ObjectMapper();
		mapper.writeValue(out, haReportManager.getUserTree(user.getUserId(),0,""));

	}
}
